<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>The Goods Page</title>
</head>
<script src="js/axios.min.js"></script>
<body>
<h1>The Goods Page</h1>
<table>
    <thead>
        <tr>
            <th>${item.id}</th>
            <th>${item.name}</th>
            <th>${item.remark}</th>
            <th>${item.createdTime}</th>
        </tr>
    </thead>
    <tbody>
    <tr>
        <td colspan="4">
            Data is Loading ...
        </td>
    </tr>
    </tbody>
</table>
</body>
<script>
    window.onload = function () {
        let url = "/doFindGoods";
        axios.get(url)
            .then(function (res) {
                console.log(res.data);
                doHandleQueryResponseResult(res.data);
            })
            .catch()
    }

    function doHandleQueryResponseResult(data) {
    let tBody=document.querySelector("tbody");
    tBody.innerHTML="";
    data.forEach(function (item){
        let tr=document.createElement("tr");
        let td=document.createElement("td");
       td.innerText=item.id;
       tr.appendChild(td);

       td=document.createElement("td")
       td.innerText=item.name;
       tr.appendChild(td);

        td=document.createElement("td")
       td.innerText=item.remark;
       tr.appendChild(td);

        td=document.createElement("td")
       td.innerText=item.createdTime;
       tr.appendChild(td);

       tBody.appendChild(tr);
    })
    }
</script>
</html>